<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>首付比例维护</title>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/aa.js"></script>
<link rel="stylesheet" href="front/css/common.css" type="text/css" />


</head>
<body>
<html:form action="maintainVehicleAction" method="post">
<input type="hidden" name="callMethod" id="callMethod" value="getVehicleTypeList"/>
<aa:zone name="areaZone">
	<div id="man_zone">

				<table width="99%" border="0" align="center" cellpadding="3"
					cellspacing="1" class="table_style">
		<tr>
			<td width="10%" class="left_title_3">序号</td>
			<td width="20%" class="left_title_3">车辆类型</td>
			<td  class="left_title_3">首付比例</td>
			
		</tr>
			<nested:iterate id="vehicleVO" property="vehicleList">
				<tr>
					<td><nested:hidden  property="id" /><nested:write name="vehicleVO" property="id" /></td>
					<td><nested:hidden  property="cllx" /><nested:write name="vehicleVO" property="cllx" /></td>
					<td><nested:text maxlength="3"  property="rate" styleClass="rate"/>%</td>
				</tr>
			</nested:iterate>
		<tr>
		<td colspan="3" ><input type="button" onclick="submitDate()" value="更新首付比例"></td>
		</tr>
		</table>
		</div>
		</aa:zone>
</html:form>


<script type="text/javascript">
function submitDate(){
	var i=0;
	$(".rate").each(function(index){
		if(isNaN(this.value)||(this.value<=0||this.value>=100)){
			i++;
			alert("首付比例必须输入数字.且只能为0和100之间的数字!");
			return false;
		}
	});
	if(i>0){
		return;
	}
	ajaxAnywhere.submitAJAX("updateVehicle", "areaZone");
	
}

AjaxAnywhere.prototype.onAfterResponseProcessing = function () {
	alert("首付比例更新成功!");
};

ajaxAnywhere.showLoadingMessage = function() {
}
</script>


</body>
</html>